package com.wwt.blog.controller;

import com.wwt.blog.service.TagService;
import com.wwt.blog.vo.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/tags")
public class TagsController {
    @Autowired
    TagService tagService;
    @GetMapping
    public Result getAllTags(){
       return tagService.findAllTags();
    }
    @GetMapping("/detail")
    public Result getAllTagsDetail(){
        return tagService.findAllTags();
    }
    //根据tagId查找标签详细信息
    @GetMapping("/detail/{id}")
    public Result getAllTagsDetailBuId(@PathVariable("id") Integer tagId){
        return tagService.findDetailById(tagId);
    }
}
